<template>
	<view class="cttit">
		<text>{{systemInfo.configName}}氏客服</text>
		<view class=""></view>
	</view>
	<view class="kbox" >
		<image v-if="customer" :src="customer.customer_qrcode" mode=""></image>
		<text>长按图片保存</text>
	</view>

	<!-- <up-action-sheet :show="showphone" :safeAreaInsetBottom='true' title='联系客服' :actions="actions"
		cancelText="取消"></up-action-sheet> -->

	<view class="content flex-center" @click="showbtm">联系客服</view>
</template>

<script setup>
	import {
		ref,onMounted
	} from 'vue';
	import {
		useSystemStore
	} from '@/stores/system.js'
	
	import { kufu } from "@/api/index.js"
	
	const systemInfo = useSystemStore()
	let showphone = ref(false)
	
		let customer=ref(null)
	
	let actions = ref([{
		name: customer.customer_tel
	}])
	
	
	
	onMounted(()=>{
		kufu().then(res=>{
			customer.value=res.data
		})
	})
	function showbtm() {
		uni.showActionSheet({
			title: '联系客服',
			itemColor: '#C7A46F',
			itemList:[customer.value.customer_tel],
			success: function(res) {
				uni.makePhoneCall({
					phoneNumber:''+customer.value.customer_tel
				})
			},
			fail: function(res) {
				console.log(res.errMsg);
			}
		});
	}
</script>
<style>
	.uni-actionsheet__action .uni-actionsheet__cell {
		color: #666 !important;
	}
</style>

<style lang="scss" scoped>
	.content {
		width: 690rpx;
		height: 88rpx;
		background: #C7A46F;
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		position: fixed;
		bottom: 100rpx;
		left: 30rpx;
		font-family: PingFang-SC, PingFang-SC;
		font-weight: bold;
		font-size: 36rpx;
		color: #FFFFFF;
	}

	.kbox {
		width: 420rpx;
		margin: 0 auto;
		display: flex;
		flex-direction: column;
		align-items: center;
		margin-top: 160rpx;

		image {

			width: 420rpx;
			height: 420rpx;

			border-radius: 16rpx;
		}

		text {
			margin-top: 20rpx;
			color: #C7A46F;
			font-size: 26rpx;
		}
	}

	.cttit {
		margin-top: 36rpx;
		margin-left: 56rpx;
		position: relative;
		display: flex;
		flex-direction: column;

		&>text {
			font-family: PingFang-SC, PingFang-SC;
			font-weight: bold;
			font-size: 32rpx;
			color: #111111;
			line-height: 24rpx;
			position: relative;
			z-index: 10;
		}

		view {
			width: 130rpx;
			height: 16rpx;
			border-radius: 20rpx;
			background: #C7A46F;
			position: absolute;
			bottom: -6rpx;
		}
	}
</style>